/*
 * 作者: junmu
 * 时间: 2025-07-22
 */
package com.hzbc.faceattendance.repository;

import com.hzbc.faceattendance.model.AttendanceRecord;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface AttendanceRecordRepository extends JpaRepository<AttendanceRecord, Long> {
    Page<AttendanceRecord> findByEntryTimeBetween(Date startDate, Date endDate, Pageable pageable);
    Page<AttendanceRecord> findByWhitelistIdAndEntryTimeBetween(Long userId, Date startDate, Date endDate, Pageable pageable);
    Page<AttendanceRecord> findByWhiteListNameContainingAndStatusAndEntryTimeBetween(String keyword,Integer status, Date startDate, Date endDate, Pageable pageable);
    Page<AttendanceRecord> findByWhiteListNameContainingAndEntryTimeBetween(String username, Date startDate, Date endDate, Pageable pageable);
    AttendanceRecord findByWhiteListNameAndStatus(String whiteName, Integer status);
    Page<AttendanceRecord> findByWhiteListNameContainingAndStatusAndEntryTimeBetween(String keyword, int i, Date startDate, Date endDate, Pageable pageable);
}